package fr.emn.integration.synthese.controle.EleveDialog;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTable;

import fr.emn.integration.synthese.presentation.JTableEleveModel;
import fr.emn.integration.synthese.presentation.JTableModulesModel;

public class ControlJButtonDeleteRow implements ActionListener {

	private JTable listeModules;

	public ControlJButtonDeleteRow(JTable listeModules) {
		this.listeModules = listeModules;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		for (int j = 0; j < listeModules.getModel().getRowCount(); j++) {
			for (int i = 0; i < listeModules.getModel().getRowCount(); i++) {
				if (listeModules.getModel().getValueAt(i, 2).equals(true)) {
					((JTableModulesModel) listeModules.getModel()).removeRow(i);
				}
			}
		}
	}

}
